			<div class="tab-pane " id="bargain">
				{if $system['is_multiple_bargain'] == 1}
				<div class="panel panel-default" role="tabpanel" style="">
					<div class="panel-heading">产品配置</div>
					<div class="panel-body" style="">
						<div id="products_items">
						{php empty($config['bargain_products'])?$config['bargain_products']=array(0,1,2):'';}
						{loop $config['bargain_products'] $index $row}
						<div class="form-group">
							<label class="col-sm-1 col-xs-12 control-label">产品{php echo $index+1;}：</label>
							<div class="col-sm-11 col-xs-12">
								<div class="col-sm-9 col-xs-12">
									<div class="input-group">
										<span class="input-group-addon">名称</span>
										<input type="text" name="bargains_name[]" class="form-control" placeholder="" value="{$row['name']}" >
									</div>
									<div class="input-group">
										<span class="input-group-addon">描述</span>
										<input type="text" name="bargains_detail[]" class="form-control" placeholder=""  value="{$row['detail']}">
									</div>
									<div class="input-group">
										<span class="input-group-addon">原价</span>
										<input type="text" class="form-control"  placeholder="" name="bargains_marketprice[]"  value="{$row['marketprice']}">
										<span class="input-group-addon">最低价</span>
										<input type="text" class="form-control"  placeholder="" name="bargains_minprice[]"  value="{$row['minprice']}">
										<span class="input-group-addon">支付定金</span>
										<input type="text" class="form-control"  placeholder="" name="bargains_joinprice[]"  value="{$row['joinprice']}">
									</div>
									<div class="input-group">
										<span class="input-group-addon">帮砍人数</span>
										<input type="text" name="bargains_friendnum[]"  class="form-control" placeholder=""  value="{php echo isset($row['friendnum'])?$row['friendnum']:0;}">
										<span class="input-group-addon">库存</span>
										<input type="text" name="bargains_stock[]"  class="form-control" placeholder=""  value="{php echo isset($row['stock'])?$row['stock']:0;}">
										<span class="input-group-addon">状态</span>
										<select class="form-control" name="bargains_status[]" style="min-width: 80px;{if $row['status'] == 1 }color: red!important;{/if}">
											<option value="0" {if $row['status'] == 0 }selected="selected"{/if}>上架</option>
											<option value="1" {if $row['status'] == 1 }selected="selected"{/if}>下架</option>
										</select>
									</div>
								</div>
								<div class="col-sm-3 col-xs-12">
									{php echo view_form_field_image('bargains_img[]',$row['img']);}
								</div>
							</div>
						</div>
						{/loop}
						</div>
						<a href="javascript:;" onclick="addProductItem();" class="btn btn-info col-lg-1"><i class="glyphicon glyphicon-plus" title="添加产品"></i>添加产品</a>
					</div>
				</div>
				{/if}
				<div class="panel panel-default" role="tabpanel" style="">
					<div class="panel-heading">砍价配置</div>
					<div class="panel-body" style="" >
						{if $system['is_multiple_bargain'] != 1}
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>价格设置</label>
							<div class="col-sm-8 col-xs-12">
								<div class="input-group">
									<span class="input-group-addon">原价</span>
									<input type="text" class="form-control"  placeholder="" name="bargain_marketprice"  value="{$config['bargain_marketprice']}">
									<span class="input-group-addon">最低价</span>
									<input type="text" class="form-control"  placeholder="" name="bargain_minprice"  value="{$config['bargain_minprice']}">
									<span class="input-group-addon">支付定金</span>
									<input type="text" class="form-control"  placeholder="" name="bargain_joinprice"  value="{$config['bargain_joinprice']}">
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">商品限购</label>
							<div class="col-sm-9 col-xs-12">
								<div class="col-sm-3 input-group">
									<span class="input-group-addon">限购</span>
									<input type="text" class="form-control"  placeholder="" name="bargain_limit"  value="{$config['bargain_limit']}">
									<span class="input-group-addon">单</span>
								</div>
								<span class="help-block">如：若开启限购，库存为0时，所有的未完成或已完成砍价但未提交订单的砍价将强制结束。</span>
								<span class="help-block">注：设置虚拟数会相应减少库存</span>
							</div>
						</div>
						{/if}
<!--						帮砍收集客资-->
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">收集帮砍人客资</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<label class="radio-inline">
									<input name="need_bargain_help_info" value="0" {if $config['need_bargain_help_info']==0} checked="checked"{/if} type="radio"> 不收集
								</label>
								<label class="radio-inline">
									<input name="need_bargain_help_info" value="1" {if $config['need_bargain_help_info']==1} checked="checked"{/if} type="radio"> 收集手机号+姓名
								</label>
								<label class="radio-inline">
									<input name="need_bargain_help_info" value="2" {if $config['need_bargain_help_info']==2} checked="checked"{/if} type="radio"> 收集手机号
								</label>
							</div>
						</div>

						<!--	黄金宝刀	-->
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">黄金宝刀</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<label class="radio-inline">
									<input name="bargain_self_grid" value="0" {if $config['bargain_self_grid']==0} checked="checked"{/if} type="radio"> 关闭
								</label>
								<label class="radio-inline">
									<input name="bargain_self_grid" value="1" {if $config['bargain_self_grid']==1} checked="checked"{/if} type="radio"> 开启
								</label>
								<span class="help-block">如：若开启，用户使用后将会砍掉一刀</span>
							</div>
						</div>
						<!--	分享砍一刀	-->
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">分享微信群砍一刀</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<label class="radio-inline">
									<input name="bargain_self_share" value="0" {if $config['bargain_self_share']==0} checked="checked"{/if} type="radio"> 关闭
								</label>
								<label class="radio-inline">
									<input name="bargain_self_share" value="1" {if $config['bargain_self_share']==1} checked="checked"{/if} type="radio"> 开启
								</label>
								<span class="help-block">如：若开启，用户分享到微信群则直接砍一刀。</span>
							</div>

						</div>
						<!--	在分享砍价翻倍	-->
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">分享砍价金翻倍</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<label class="radio-inline">
									<input name="bargain_self_dshare" value="0" {if $config['bargain_self_dshare']==0} checked="checked"{/if} type="radio"> 关闭
								</label>
								<label class="radio-inline">
									<input name="bargain_self_dshare" value="1" {if $config['bargain_self_dshare']==1} checked="checked"{/if} type="radio"> 开启
								</label>
								<span class="help-block">如：若开启，用户分享到微信群后，再次分享还可以再砍一刀。</span>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">直接原价购买</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<label class="radio-inline">
									<input name="bargain_isdirectbuy" value="0" {if $config['bargain_isdirectbuy']==0} checked="checked"{/if} type="radio"> 关闭
								</label>
								<label class="radio-inline">
									<input name="bargain_isdirectbuy" value="1" {if $config['bargain_isdirectbuy']==1} checked="checked"{/if} type="radio"> 开启
								</label>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>付款方式</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<label class="radio-inline">
									<input name="bargain_mode" value="0" {if $config['bargain_mode']==0} checked="checked"{/if} type="radio"> 先付款后砍价-不退
								</label>
								<label class="radio-inline">
									<input name="bargain_mode" value="1" {if $config['bargain_mode']==1} checked="checked"{/if} type="radio"> 先付款后砍价-失败退
								</label>
								<label class="radio-inline">
									<input name="bargain_mode" value="2" {if $config['bargain_mode']==2} checked="checked"{/if} type="radio"> 砍至最低价下单
								</label>
								<label class="radio-inline">
									<input name="bargain_mode" value="3" {if $config['bargain_mode']==3} checked="checked"{/if} type="radio"> 砍价中随时可下单
								</label>
								<span class="help-block">如：若开启'先付款后砍价'则先支付最低价，再邀请好友砍价；失败退是指在规定时间内未完成砍价者直接原路退回</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>砍价方式1</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<div class="input-group">
									{if $system['is_multiple_bargain'] != 1}
									<span class="input-group-addon">帮砍人数</span>
									<input type="text" class="form-control"  placeholder="" name="bargain_friendnum"  value="{$config['bargain_friendnum']}">
									{else}
									<span class="input-group-addon">用户最多可砍几个商品</span>
									<input type="text" class="form-control"  placeholder="" name="bargain_products_limit"  value="{$config['bargain_products_limit']}">
									{/if}
									<span class="input-group-addon">帮砍价格浮动</span>
									<input type="text" class="form-control"  placeholder="" name="bargain_pricerange"  value="{$config['bargain_pricerange']}">
									<span class="input-group-addon">%</span>
								</div>
								{if $system['is_multiple_bargain'] == 1}
								<span class="help-block">多个商品，用户最多可砍几个商品，默认为0不限制</span>
								{/if}
								<span class="help-block">如：固定帮砍人数，如699元只需要10人砍到69元；则帮砍人数填10；帮砍掉的价格浮动20%，则每次砍价格在699元/10人*80%至699元/10人*120%之间；</span>
								<span class="help-block">注：若开启了使用宝刀和分享微信群，每次砍价将抵扣人数；也就是设置了10人，用宝刀砍了一次还需要9人就可砍价成功；</span>
							</div>
						</div>

						<div class="form-group">
							<label class="col-xs-12 col-sm-3 col-md-2 control-label">砍价方式2：</label>
							<div class="col-sm-9 col-xs-12">
								<table class='table'>
									<thead>
									<tr>
										<th>大于金额数(请倒叙设置如 1000、800)</th>
										<th>砍价范围从</th>
										<th>到</th>
										<th>操作</th>
									</tr>
									</thead>
									<tbody id="rule_items">
									{loop $config['bargain_rules'] $rule_item}
									<tr >
										<td><input name="rule_price[]" type="text"
												   class="form-control span3" value="{$rule_item['rule_price']}"
										/></td>
										<td><input name="rule_start[]" type="text"
												   class="form-control span3" value="{$rule_item['rule_start']}"
										/></td>
										<td><input name="rule_end[]" type="text"
												   class="form-control span1" value="{$rule_item['rule_end']}"
										/></td>
										<td>
											<input  name="rule_id[]" type="hidden" value="{$rule_id['id']}" />
											<a href='javascript:;' onclick='removeRuleItem(this)'><i
													class='glyphicon glyphicon-remove'></i> 删除</a></td>
									</tr>
									{/loop}
									</tbody>
								</table>
								<a href="javascript:;" onclick="addRuleItem();"><i class="glyphicon glyphicon-plus" title="添加规则"></i>添加规则</a>
								<div class="alert alert-info" role="alert" style="margin-top:5px">
									合理的砍价规则设置可以更好的控制砍价人数，砍价规则范例如下：
									<p>第一条规则：100（大于金额数）-5（砍价范围从）-10（到）</p>
									<p>第二条规则：50（大于金额数）-1（砍价范围从）-5（到）</p>
									<p>根据上两条砍价规则，比如当前砍价活动原价160元，底价50元。那当前用户发起砍价后金额处于100元以上时是触发第一条规则，其他人帮砍一次是砍掉5-10元，当砍到100元以下，50元以上时开始触发第二条记录，别人帮他砍一次是掉1-5元</p>
									<p>如果当前砍价原价为20元，底价为10元，您想让至少5人参与才可以砍到底价，就可以设置一条规则为:</p>
									<p>10（大于金额数）-1（砍价范围从）-2（到）</p>
									<p>紧接上述场景，如果您想让用户只需一个人就可以砍到底价，可以设置一条规则为：</p>
									<p>10（大于金额数）-10（砍价范围从）-10（到）</p>
								</div>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">界面显示</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<label class="radio-inline">
									<input name="bargain_showinfojoin" value="0" {if $config['bargain_showinfojoin']==0} checked="checked"{/if} type="radio"> 参于人数
								</label>
								<label class="radio-inline">
									<input name="bargain_showinfojoin" value="1" {if $config['bargain_showinfojoin']==1} checked="checked"{/if} type="radio"> 报名人数
								</label>
							</div>
						</div>
						<div class="panel-body" style="">
							<div class="form-group">
								<label class="col-sm-2 col-xs-12 control-label">好友帮砍限制：</label>
								<div class="col-sm-8 col-xs-12">
									<div class="col-sm-3 input-group">
										<input type="text" class="form-control"  placeholder="" name="bargain_limitfriend"  value="{$config['bargain_limitfriend']}">
										<span class="input-group-addon">人</span>
									</div>
									<span class="help-block">限制砍价人数的功能，比如你帮A砍过，就不能在帮其他人砍了。设置可以改变的数字，填几，就限制可以帮助几个人砍价。</span>
								</div>
							</div>
						</div>
						<div class="panel-body" style="">
							<div class="form-group">
								<label class="col-sm-2 col-xs-12 control-label">砍价时间限制：</label>
								<div class="col-sm-8 col-xs-12">
									<div class="col-sm-3  input-group">
										<input type="text" class="form-control"  placeholder="" name="bargain_limittime"  value="{$config['bargain_limittime']}">
										<span class="input-group-addon">小时</span>
									</div>
									<span class="help-block">请直接填写小时数，例如24小时有效期此处填写24即可，计时时间从用户发起砍价开始，超出此时间后砍价失败，用户可重新发起砍价，设置为0则不限制，默认为0。</span>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">支付定金抢购文字</label>
							<div class="col-sm-8 col-xs-12">

								<div class="input-group">
									<span class="input-group-addon">未支付</span>
									<input type="text" class="form-control"  placeholder="" name="bargain_unpaid_button"  value="{if empty($config['bargain_unpaid_button'])}支付定金抢购{else}{$config['bargain_unpaid_button']}{/if}">
									<span class="input-group-addon">已支付</span>
									<input type="text" class="form-control"  placeholder="" name="bargain_paid_button"  value="{if empty($config['bargain_paid_button'])}您已支付定金{else}{$config['bargain_paid_button']}{/if}">
								</div>

								<span class="help-block">开启【砍价中随时可下单】且设置【支付定金】时，随时下单支付按扭文字；默认：支付定金抢购</span>
							</div>
						</div>

						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">砍价流程提示图</label>
							<div class="col-sm-8 col-xs-12">
								{php echo view_form_field_image('bargain_liucheng',$config['bargain_liucheng']);}
								<span class="help-block">活动内容上方显示，默认：https://css2020.yixuan.net/2020css/bargain/images/liucheng.jpg</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">邀请好友提示图</label>
							<div class="col-sm-8 col-xs-12">
								{php echo view_form_field_image('bargain_yaoqing',$config['bargain_yaoqing']);}
								<span class="help-block">活动内容上方显示，默认：https://css2020.yixuan.net/2020css/bargain/images/yaoqing.jpg</span>
							</div>
						</div>

					</div>
				</div>
				<div class="panel panel-default" role="tabpanel" style="">
					<div class="panel-heading">帮砍有礼</div>
					<div class="panel-body" style="">
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<label class="radio-inline">
									<input name="bargain_help_gift" value="0" {if $config['bargain_help_gift']==0} checked="checked"{/if} type="radio"> 关闭
								</label>
								<label class="radio-inline">
									<input name="bargain_help_gift" value="1" {if $config['bargain_help_gift']==1} checked="checked"{/if} type="radio"> 开启
								</label>
								<span class="help-block">如：若开启，帮砍用户在填写信息后可获得选定礼品</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">收集资料</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<label class="radio-inline">
									<input name="bargain_help_info" value="0" {if $config['bargain_help_info']==0} checked="checked"{/if} type="radio"> 领取礼物时收集
								</label>
								<label class="radio-inline">
									<input name="bargain_help_info" value="1" {if $config['bargain_help_info']==1} checked="checked"{/if} type="radio"> 帮砍强制收集
								</label>
								<span class="help-block">如：帮砍强制收集，不填信息不可帮砍</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">强制收集表单提示语</label>
							<div class="col-sm-8 col-xs-12">
								<div class="col-sm-10 input-group">
									<input type="text" class="form-control"  placeholder="" name="bargain_help_info_tips"  value="{php echo empty($config['bargain_help_info_tips'])?'帮好友砍价后将会获得精美礼品一份':$config['bargain_help_info_tips'];}">
								</div>
								<span class="help-block">如：帮好友砍价后将会获得精美礼品一份</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼首页浮标</label>
							<div class="col-sm-9 col-md-8 col-lg-8 col-xs-12">
								<div class="col-sm-8 col-xs-12">
									{php echo view_form_field_image('bargain_help_gift_icon',$config['bargain_help_gift_icon']?$config['bargain_help_gift_icon']:'https://css2020.yixuan.net/2020css/yx2020/images/dpy_gift.png');}
									<span class="help-block">如：图片尺寸：500*500px</span>
								</div>
								<span class="help-block">如：首页帮砍有礼的浮标</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼：收集姓名别称</label>
							<div class="col-sm-8 col-xs-12">
								<div class="col-sm-3 input-group">
									<input type="text" class="form-control"  placeholder="" name="bargain_help_gift_other_name"  value="{$config['bargain_help_gift_other_name']}">
								</div>
								<span class="help-block">填写收集姓名别称，如：宝宝姓名</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼：收集手机号别称</label>
							<div class="col-sm-8 col-xs-12">
								<div class="col-sm-3 input-group">
									<input type="text" class="form-control"  placeholder="" name="bargain_help_gift_other_phone"  value="{$config['bargain_help_gift_other_phone']}">
								</div>
								<span class="help-block">填写收集手机号别称，如：爸爸电话</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼：礼品1-名称</label>
							<div class="col-sm-8 col-xs-12">
								<div class="col-sm-3 input-group">
									<input type="text" class="form-control"  placeholder="" name="bargain_help_gift_first_name"  value="{$config['bargain_help_gift_first_name']}">
								</div>
								<span class="help-block">填写帮砍有礼：礼品1-名称</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼：礼品1-图片</label>
							<div class="col-sm-8 col-xs-12">
								{php echo view_form_field_image('bargain_help_gift_first',$config['bargain_help_gift_first']);}
								<span class="help-block">如：图片尺寸：500*500px</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼：礼品2-名称</label>
							<div class="col-sm-8 col-xs-12">
								<div class="col-sm-3 input-group">
									<input type="text" class="form-control"  placeholder="" name="bargain_help_gift_second_name"  value="{$config['bargain_help_gift_second_name']}">
								</div>
								<span class="help-block">填写帮砍有礼：礼品2-名称</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼：礼品2-图片</label>
							<div class="col-sm-8 col-xs-12">
								{php echo view_form_field_image('bargain_help_gift_second',$config['bargain_help_gift_second']);}
								<span class="help-block">如：图片尺寸：500*500px</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼：礼品3-名称</label>
							<div class="col-sm-8 col-xs-12">
								<div class="col-sm-3 input-group">
									<input type="text" class="form-control"  placeholder="" name="bargain_help_gift_third_name"  value="{$config['bargain_help_gift_third_name']}">
								</div>
								<span class="help-block">填写帮砍有礼：礼品3-名称</span>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">帮砍有礼：礼品3-图片</label>
							<div class="col-sm-8 col-xs-12">
								{php echo view_form_field_image('bargain_help_gift_third',$config['bargain_help_gift_third']);}
								<span class="help-block">如：图片尺寸：500*500px</span>
							</div>
						</div>
					</div>
				</div>
				{if $system['bargain_gift'] == '1'}
				<div class="panel panel-default" role="tabpanel" style="">
					<div class="panel-heading">曦尊定制</div>
					<div class="panel-body" style="">
						<div class="panel-body" style="">
							<div class="form-group">
								<label class="col-sm-2 col-xs-12 control-label">抢定优惠套餐：</label>
								<div class="col-sm-8 col-xs-12">
									<div class="input-group">
										<span class="input-group-addon">支付金额</span>
										<input type="text" class="form-control"  placeholder="" name="bargain_buy"  value="{$config['bargain_buy']}">
										<span class="input-group-addon">元</span>
										<span class="input-group-addon">未支付按扭文字</span>
										<input type="text" class="form-control"  placeholder="" name="bargain_buy_text"  value="{$config['bargain_buy_text']}">
									</div>
									<div class="input-group">

										<span class="input-group-addon">未支付按扭显示支付价格</span>
										<select class="form-control" name="bargain_buy_show_money">
											<option value="0" {if $config['bargain_buy_show_money'] == 0 }selected="selected"{/if}>不显示</option>
											<option value="1" {if $config['bargain_buy_show_money'] == 1 }selected="selected"{/if}>显示</option>
										</select>
										<span class="input-group-addon">已支付按扭文字</span>
										<input type="text" class="form-control"  placeholder="" name="bargain_order_text"  value="{$config['bargain_order_text']}">
									</div>
									<span class="help-block">砍价的同时随时可下单抢定优惠，底部按扭会一直存在</span>
								</div>
							</div>
						</div>
						<div class="panel-body" style="">
							<div class="form-group">
								<label class="col-sm-2 col-xs-12 control-label">邀请好友有礼</label>
								<div class="col-sm-8 col-xs-12">
									<div class="input-group">
										<span class="input-group-addon">邀请</span>
										<input type="text" class="form-control"  placeholder="" name="bargain_gift_limit"  value="{$config['bargain_gift_limit']}">
										<span class="input-group-addon">位好友</span>
										<span class="input-group-addon">礼品名称</span>
										<input type="text" class="form-control"  placeholder="" name="bargain_gift_name"  value="{$config['bargain_gift_name']}">
									</div>
									<span class="help-block">如：砍价需要10人帮砍，帮砍人数达到5人时可获得10寸摆台1个</span>
								</div>
							</div>
						</div>
						<div class="form-group">
							<label class="col-sm-2 col-xs-12 control-label">邀请好友有礼：礼品图</label>
							<div class="col-sm-8 col-xs-12">
								{php echo view_form_field_image('bargain_gift_img',$config['bargain_gift_img']);}
								<span class="help-block">如：图片尺寸：500*500px</span>
							</div>
						</div>


					</div>
				</div>
				{/if}

				{if $system['is_multiple_bargain'] == 1}
				<div class="panel panel-default" role="tabpanel" style="">
					<div class="panel-heading">产品介绍</div>
					<div class="panel-body" style="">
						<div id="products_infos">
							{php empty($config['bargain_products'])?$config['bargain_products']=array(0,1,2):'';}
							{loop $config['bargain_products'] $index $row}
							<div class="form-group">
								<label class="col-sm-1 col-xs-12 control-label">产品{php echo $index+1;}：</label>
								<div class="col-sm-11 col-xs-12">
										{php echo view_form_field_multi_image('bargains_info'.$index,$row['info']);}
								</div>
							</div>
							{/loop}
						</div>
					</div>
				</div>
				{/if}
			</div>

			<script>
				var pro_id = {php echo count($config['bargain_products']);};
				function addProductItem() {
					pro_id  ++;
					var html =  "			<div class=\"form-group\">\n";
					html +=  "				<label class=\"col-sm-1 col-xs-12 control-label\">产品" + pro_id + "：</label>\n";
					html +=  "				<div class=\"col-sm-11 col-xs-12\">\n";
					html +=  "					<div class=\"col-sm-9 col-xs-12\">\n";
					html +=  "						<div class=\"input-group\">\n";
					html +=  "							<span class=\"input-group-addon\">名称</span>\n";
					html +=  "							<input type=\"text\" name=\"bargains_name[]\" class=\"form-control\" placeholder=\"\" value=\"\">\n";
					html +=  "						</div>\n";
					html +=  "						<div class=\"input-group\">\n";
					html +=  "							<span class=\"input-group-addon\">描述</span>\n";
					html +=  "							<input type=\"text\" name=\"bargains_detail[]\" class=\"form-control\" placeholder=\"\" value=\"\">\n";
					html +=  "						</div>\n";
					html +=  "						<div class=\"input-group\">\n";
					html +=  "							<span class=\"input-group-addon\">原价</span>\n";
					html +=  "							<input type=\"text\" class=\"form-control\" placeholder=\"\" name=\"bargains_marketprice[]\" value=\"\">\n";
					html +=  "							<span class=\"input-group-addon\">最低价</span>\n";
					html +=  "							<input type=\"text\" class=\"form-control\" placeholder=\"\" name=\"bargains_minprice[]\" value=\"\">\n";
					html +=  "							<span class=\"input-group-addon\">支付定金</span>\n";
					html +=  "							<input type=\"text\" class=\"form-control\" placeholder=\"\" name=\"bargains_joinprice[]\" value=>\n";
					html +=  "						</div>\n";
					html +=  "						<div class=\"input-group\">\n";
					html +=  "							<span class=\"input-group-addon\">帮砍人数</span>\n";
					html +=  "							<input type=\"text\" name=\"bargains_friendnum[]\" class=\"form-control\" placeholder=\"\" value=\"\">\n";
					html +=  "							<span class=\"input-group-addon\">库存</span>\n";
					html +=  "							<input type=\"text\" name=\"bargains_stock[]\" class=\"form-control\" placeholder=\"\" value=\"\">\n";
					html +=  "							<span class=\"input-group-addon\">库存</span>\n";
					html +=  "							<select class=\"form-control\" name=\"bargains_status[]\" style=\"min-width: 80px;\">\n";
					html +=  "								<option value=\"0\" >上架</option>\n";
					html +=  "								<option value=\"1\" >下架</option>\n";
					html +=  "							</select>\n";
					html +=  "						</div>\n";
					html +=  "					</div>\n";
					html +=  "					<div class=\"col-sm-3 col-xs-12\">							\n";
					html +=  "	<div class=\"input-group \">\n";
					html +=  "		<input type=\"text\" name=\"bargains_img[]\" value=\"\" class=\"form-control\" autocomplete=\"off\">\n";
					html +=  "		<span class=\"input-group-btn\">\n";
					html +=  "			<button class=\"btn btn-default\" type=\"button\" onclick=\"showImageDialog(this);\">选择图片</button>\n";
					html +=  "		</span>\n";
					html +=  "	</div>\n";
					html +=  "	<div class=\"input-group \" style=\"margin-top:.5em;\">\n";
					html +=  "		<img src=\"./resource/images/nopic.jpg\" onerror=\"this.src='./resource/images/nopic.jpg'; this.title='图片未找到.'\" class=\"img-responsive img-thumbnail\" width=\"150\">\n";
					html +=  "		<em class=\"close\" style=\"position:absolute; top: 0px; right: -14px;\" title=\"删除这张图片\" onclick=\"deleteImage(this)\">×</em>\n";
					html +=  "	</div>						</div>\n";
					html +=  "				</div>\n";
					html +=  "			</div>\n";
					$("#products_items").append(html);
					var pro_id_name = pro_id - 1;

					html="<div class=\"form-group\">\n" +
							"\t<label class=\"col-sm-1 col-xs-12 control-label\">产品" + pro_id + "：</label>\n" +
							"\t<div class=\"col-sm-11 col-xs-12\">\n" +
							"\t<div class=\"input-group\">\n" +
							"\t<input type=\"text\" class=\"form-control\" readonly=\"readonly\" value=\"\" placeholder=\"批量上传图片\" autocomplete=\"off\">\n" +
							"\t<span class=\"input-group-btn\">\n" +
							"\t\t<button class=\"btn btn-default\" type=\"button\" onclick=\"uploadMultiImage(this);\">选择图片</button>\n" +
							"\t\t<input type=\"hidden\" value=\"bargains_info" + pro_id_name + "\" />\n" +
							"\t</span>\n" +
							"</div>\n" +
							"<div class=\"input-group multi-img-details\"></div>\n" +
							"</div>\n" +
							"</div>";
					$("#products_infos").append(html);
				}
				function addRuleItem() {
					var html = "<tr>";
						html += '<td><input name="rule_price[]" type="text" class="form-control span3" value="" /></td>';
						html += '<td><input name="rule_start[]" type="text" class="form-control span3" value="" /></td>';
						html += '<td><input name="rule_end[]" type="text" class="form-control span1" value="" /></td>';
						html += '<td> <input  name="rule_id[]" type="hidden" value="" />&nbsp;<a href="javascript:;" onclick="removeRuleItem(this)" ><i class="glyphicon glyphicon-remove"></i> 删除</a></td>';
						html += "</tr>";
					$("#rule_items").append(html);
				}
				function removeRuleItem(obj) {
					$(obj).parent().parent().remove();
				}
			</script>
